package br.edu.ufcg.embedded.eolica.domain;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import br.edu.ufcg.embedded.eolica.util.MySerializableResource;

public class Attribute extends MySerializableResource {

	private String name;
	
	public Attribute() {}
	
	/**
	 * @param name
	 */
	public Attribute(String name) {
		super();
		this.name = name;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	public void read(InputStream arg0) throws IOException {
		DataInputStream input = new DataInputStream(arg0);
		name = input.readUTF();
		input.reset();
		input.close();
	}

	public void write(OutputStream arg0) throws IOException {
		DataOutputStream output = new DataOutputStream(arg0);
		output.writeUTF(name);
		output.flush();
		output.close();
		
	}

}
